<?php
class UsersModel extends Model{
    protected $_validate = array(
		array('UserName','require','登录邮箱必须填写！'),
		array('OrgLocation','require','高校所在地区必须填写！'),
		array('OrgName','require','高校名称必须填写！'),
		array('TrueName','require','姓名必须填写！'),
		array('Password','require','密码必须填写！'),
		array('PhoneNumber','require','手机号码必须填写！'),
		array('Email','require','常用邮箱必须填写！')
	);
	
	public $userinfo;
	public $userid;
	
	public function __construct($userid){
		parent::__construct();
		$this->userid = $userid;
		$this->userinfo = $this->getUser();
	}
	
	private function getUser(){
		$Model = M();
		return $Model->query('select UserId,UserName,SchoolId,OrgLocation,OrgName,TrueName,Email,Avatar,PhoneNumber,LastLoginDate from users where UserId='.$this->userid);
	}	
}